import { Link } from 'umi';

const columns = [
  {
    title: '机构名称',
    key: 'name',
    dataIndex: 'name'
  },
  {
    title: '机构编号',
    key: 'unitNo',
    dataIndex: 'unitNo'
  },
  {
    title: '机构类型',
    key: 'typeName',
    dataIndex: 'typeName'
  },
  {
    title: '学校类型',
    key: 'schoolTypeName',
    dataIndex: 'schoolTypeName'
  },
  {
    title: '所属市',
    key: 'city',
    dataIndex: 'city',
    align: 'center'
  },
  {
    title: '所属区县',
    key: 'county',
    dataIndex: 'county',
    align: 'center'
  },
  {
    title: '到馆人数',
    key: 'booker',
    dataIndex: 'booker',
    align: 'center',
    sorter: (a, b) => a.booker - b.booker
  },
  {
    title: '读者总数',
    key: 'readerTotal',
    dataIndex: 'readerTotal',
    align: 'center',
    sorter: (a, b) => a.readerTotal  - b.readerTotal 
  },
  {
    title: '到馆率',
    key: 'rate',
    dataIndex: 'rate',
    align: 'center',
    sorter: (a, b) => a.rate - b.rate 
  },
  {
    title: '操作',
    key: 'operation',
    fixed: 'right',
    align: 'center',
    render: (text, record) => (
      <Link to={{pathname:"/statistics/flow/attend/detail",state: {...record}}}>详情</Link>
    )
  }
]

export default columns